$(document).ready(function () {
    var startDate=[];
    var finishDate=[];
    var name=[];
    var subject=[];
    var finishTimes=[];
    $("#queding").click(function(){
        $("#t1 tr:not(:first)").empty();

        var date1=$("#tdate1").val();
        var date2=$("#tdate2").val();
        var id=$("#selectStudent").val();
        $.ajax({
            type: "GET",
            url: "/report/getUser",
            dataType: "json",
            data: {
                userId:id,
                date1:date1,
                date2:date2
            },
            success: function (data) {
                $("#i1").val("").empty();
                $("#i2").val("").empty();
                $("#i3").val("").empty();
                $("#i4").val("").empty();
                $("#i5").val("").empty();
                console.log(data);
                for (var i in data) {
                    $("#t1").append("<tr><td>" + data[i].startDate+ "</td><td>" + data[i].finishDate +"</td><td>"+data[i].name+"</td><td>"+data[i].subject+ "</td><td>"+data[i].finishTimes+"</td></tr>");


                    startDate.push(data[i].startDate);
                    $("#i1").val(startDate);


                    finishDate.push(data[i].finishDate);
                    $("#i2").val(finishDate);


                    name.push(data[i].name);
                    $("#i3").val(name);


                    subject.push(data[i].subject);
                    $("#i4").val(subject);


                    finishTimes.push(data[i].finishTimes);
                    $("#i5").val(finishTimes);
                }
                // example();
            },
            error: function (xhr, textStatus) {
                console.log('错误');
                console.log(xhr);
                console.log(textStatus);
            }
        });
    })
});